import time
import unittest

from selenium import webdriver
from Page import Page
from selenium.webdriver.common.by import By
class MyTestCase(unittest.TestCase):


    def setUp(self) -> None:
        # 打开谷歌浏览器
        self.driver = webdriver.Chrome()
        # 窗口最大化
        self.driver.maximize_window()
        print('start case')

    def tearDown(self) -> None:
        # 退出
        self.driver.quit()
        time.sleep(5)
        print('case end')

    def test_something(self):
        po = Page(self.driver)
        po.test_login()
        dy1 = self.driver.find_element(By.XPATH,'/html/body/div[1]/div/section/section/main/form/div/div[2]/div/div/button[3]').text
        print(f'断言1的值:{dy1}')
        dy2 = self.driver.find_element(By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/form/div[2]/div[3]/div/div/button').text
        print(f'打印断言2的值:{dy2}')
        self.assertEqual(dy1, '重置')
        self.assertIn(dy2,'批量删除')


if __name__ == '__main__':
    unittest.main()
